package com.example.demo.controller.db;

import com.example.demo.dao.ProductCategoryDao;
import com.example.demo.service.interf.ProductCategoryService;
import com.example.demo.utils.ResultVOUtil;
import com.example.demo.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by hongzhenyue on 18/3/2.
 */
@RestController
public class ProductCategoryController {
    @Autowired
    private ProductCategoryService categoryService;

    @GetMapping("db/findByCategoryType/{type}")
    @ApiOperation(value = "查询类型", notes = "根据CategoryType来查询类型")
    public ResultVO getCategory(@PathVariable("type") Integer type) {
        return ResultVOUtil.success(categoryService.findByCategoryType(type));
    }
}
